<script lang="ts" setup>
import * as echarts from 'echarts/core'
//  直接引入必要的echarts组件 然后引入echartsBaseVue使用即可 正常传参
import { GridComponent, LegendComponent } from 'echarts/components'
import { BarChart,LineChart } from 'echarts/charts'
import { CanvasRenderer } from 'echarts/renderers'
import echartsBaseVue from './echartsBase.vue'
// import type { BaseOptionType } from './optionPropsType'
echarts.use([GridComponent, BarChart, CanvasRenderer,LegendComponent,LineChart])
// props 
type ProPick<T, K extends keyof T> = NonNullable<T[K]>
interface BaseOptionType {
  echarts?: any
  options?: {
    xAxis?: any
    yAxis?: any
    series: any[]
    [key: string]: any
  }
  optionsFunc?(echarts?: any,targetEcharts?:any): ProPick<BaseOptionType, 'options'>
}
const props = defineProps<BaseOptionType>()
</script>
<template>
  <echartsBaseVue 
    :options="props.options" 
    :options-func="props.optionsFunc" 
    :echarts="echarts">
    </echartsBaseVue>
</template>
<style scoped></style>

